// main.cpp
// Tests operations on SymbolicMath::Poly objects.
// by Jeff Ward

#include <iostream>
#include "Poly.h"
using namespace std;
using namespace SymbolicMath;

int main()
{
	Poly p1("x^2+3");
	cout << "p1 = " << p1 << endl;
	cout << "-p1 = " << -p1 << endl;
	Poly p2("x^2-3");
	cout << "p2 = " << p2 << endl;
	cout << "p1 + p2 = " << p1 + p2 << endl;
	cout << "p1 - p2 = " << p1 - p2 << endl;
	cout << "p1 * p2 = " << p1 * p2 << endl;
	cout << "p1(1.5) = " << p1(1.5) << endl;
	cout << "p1 * 4 = " << p1 * 4 << endl;
	cout << "Poly(2x^3+x-2) * Poly(-6x^2+3) = " 
		 << Poly("2x^3+x-2") * Poly("-6x^2+3") << endl;
	cout << "p1 == Poly(x^2+3) = " << (p1 == Poly("x^2+3")) << endl;
	cout << "p1 == Poly(x^2+3.0000001) = " 
		 << (p1 == Poly("x^2+3.0000001")) << endl;
	cout << "p1 *= p1 = " << (p1 *= p1) << endl;
	cout << "p1 = " << p1 << endl;
	cout << "p1 += p1 = " << (p1 += p1) << endl;
	cout << "p1 -= p1 = " << (p1 -= p1) << endl;
	cout << "Poly() = " << Poly() << endl;

 }